import axios from "~/axios";

// 查询列表
export function tableList(type, name) {
  return axios.get('/api/admin/acl/permission', {
    params: {
      type: type,
      name: name
    }
  });
}

// 查询单个信息
export function getInfo(id) {
  return axios.get('/api/admin/acl/permission/info/' + id);
}

// 新增或修改
export function saveOrUpdate(formData) {
  let url = ''
  if(formData.id === 0) {
    url = 'save'
  } else {
    url = 'update'
  }
  return axios.post('/api/admin/acl/permission/' + url, formData);
}

// 删除
export function batchRemove(id) {
  return axios.post('/api/admin/acl/permission/remove/' + id);
}
